package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.ShoppingCart;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ShoppingCartMapper {
    /**
     * 查询购物车菜品
     * @param shoppingCart
     */
    ShoppingCart getOneData(@Param("shopping") ShoppingCart shoppingCart);

    /**
     * 修改购物车商品信息
     * @param shoppingCart
     */
    void updata(@Param("shoppingCart") ShoppingCart shoppingCart);

    /**
     * 添加购物车
     * @param shoppingCart
     */

    void add(@Param("shoppingCart") ShoppingCart shoppingCart);

    /**
     * 查看购物车
     * @return
     */
    List<ShoppingCart> selectShoppingCart(@Param("userId") Long id);

    /**
     * 清空购物车
     */
    void emptyShoppingCart(@Param("userId") Long id);

    /**
     * 单个删除
     * @param id
     */
    void updateShoppingCart(@Param("id") Long id);


    ShoppingCart selectShoppingCartByDishId(@Param("dishId") Long dishId,@Param("userId")Long userId);

    ShoppingCart selectShoppingCartBySetmealId(@Param("setmealId") Long setmealId, @Param("userId") Long currentId);
}
